package servlet;
import servlet.Connections;
import java.sql.*;
import java.io.*;
import java.util.*;

public class SelectState 
{
	Connections conn=new Connections();
	ResultSet rs=null;
	Statement stmt=null;
	String query="select * from state";
	ArrayList stateCityList=new ArrayList();
	
	public ArrayList StateCitySelect()
	{
		try
		{
			stmt=conn.getConnection().createStatement();
			rs=stmt.executeQuery(query);
		
			while(rs.next())
			{
				stateCityList.add(rs.getString(2));
			}
			
			rs.close();
			stmt.close();
			conn.getConnection().close();
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		return stateCityList;
	}	
	
	
}
